import Cookies from 'js-cookie'

const KEY = 'hm--vuex-token'

export function getToken() {
  const str = Cookies.get(KEY)
  if (!str) return null
  return JSON.parse(str)?.user?.token
}